﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace Nova_BLL
{
    public class DepartMent
    {
        int i = 0;
        DataSet ds = null;
        Nova_DAL.DepartMent Nova_DAL_DepartMent = new Nova_DAL.DepartMent();


        ///<summary>
        ///获取工作组列表
        ///</summary>
        ///<param name="sQL">SQL</param>
        ///<returns>返回DataSet</returnss>
        ///Writer：[王成友]
        ///Create Date： [2010-5-20]
        ///</summary>
        public DataSet DataListvDepartment()
        {
            try
            {
                ds = Nova_DAL_DepartMent.DataListvDepartment();

            }
            catch (Exception ex)
            {
                Console.Write(ex.ToString());
            }

            return ds;
        }

        /// <summary>
        /// 获取部门详细信息
        /// </summary>
        /// <param name="ID">ID</param>
        /// <returns>返回DataSet</returns>
        ///Writer：[夏鑫]
        ///Create Date： [2010-5-20]
        public DataSet DataListvDepartment(string vDepartmentNo)
        {
            try
            {
                ds = Nova_DAL_DepartMent.DataListvDepartment(vDepartmentNo);

            }
            catch (Exception ex)
            {
                Console.Write(ex.ToString());
            }

            return ds;
        }

        /// <summary>
        /// 获取部门详细信息
        /// </summary>
        /// <param name="ID">ID</param>
        /// <returns>返回DataSet</returns>
        ///Writer：[夏鑫]
        ///Create Date： [2010-5-20]
        public DataSet DataListvDepartment(string PID, string strvDepartmentNo)
        {
            try
            {
                ds = Nova_DAL_DepartMent.DataListvDepartment(PID, strvDepartmentNo);

            }
            catch (Exception ex)
            {
                Console.Write(ex.ToString());
            }

            return ds;
        }

        ///<summary>
        ///增加部门
        ///</summary>
        ///<param name="sQL">vDepartmentNo,vDepartment</param>
        ///<returns>返回int,0失败,1成功</returnss>
        ///Writer：[王成友]
        ///Create Date： [2010-5-20]
        ///</summary>
        public int AddDepartMent(Nova_MOD.DepartMent DepartMent)
        {
            try
            {
                i = Nova_DAL_DepartMent.AddDepartMent(DepartMent);
            }
            catch (Exception ex)
            {
                Console.Write(ex.ToString());
            }
            return i;
        }

        ///<summary>
        ///修改部门
        ///</summary>
        ///<param name="sQL">vDepartmentNo,vDepartment,id</param>
        ///<returns>返回int,0失败,1成功</returnss>
        ///Writer：[王成友]
        ///Create Date： [2010-5-20]
        ///</summary>
        public int UpdateDepartMent(Nova_MOD.DepartMent DepartMent)
        {
            try
            {
                i = Nova_DAL_DepartMent.UpdateDepartMent(DepartMent);
            }
            catch (Exception ex)
            {
                Console.Write(ex.ToString());
            }
            return i;
        }

        ///<summary>
        ///删除部门
        ///</summary>
        ///<param name="sQL">id</param>
        ///<returns>返回int,0失败,1成功</returnss>
        ///Writer：[王成友]
        ///Create Date： [2010-5-20]
        ///</summary>
        public int DeleteDepartMent(string id)
        {
            try
            {
                i = Nova_DAL_DepartMent.DeleteDepartMent(id);
            }
            catch (Exception ex)
            {
                Console.Write(ex.ToString());
            }
            return i;
        }

        /// <summary>
        /// 删除多个工作组
        /// </summary>
        /// <param name="strID">部门id</param>
        /// <returns>返回int,0失败,1成功</returns>
        ///Writer：[夏鑫]
        ///Create Date： [2010-5-28]
        public int DeleteAllDepartMent(string strID)
        {
            try
            {
                i = Nova_DAL_DepartMent.DeleteAllDepartMent(strID);
            }
            catch (Exception ex)
            {
                Console.Write(ex.ToString());
            }
            return i;
        }

    }
}

